import { http } from "@/utils/http";
import { baseUrlApi, type Result, type ListResult } from "@/utils/apiPublic";
import { BaseApi } from "../base";

/** 获取系统管理-菜单管理列表 */
export const getMenuList = (data?: object) => {
  return http.request<ListResult>("post", baseUrlApi("admin/menu/index"), {
    data
  });
};

export const menuSave = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("admin/menu/save"), { data });
};

export const menuDelete = (data?: object) => {
  return http.request<Result>("post", baseUrlApi("admin/menu/delete"), {
    data
  });
};

export const menuApi = new BaseApi("admin/menu");